package cn.lml.lession.auth.exception;

public class CustomException extends RuntimeException{
	private static final long serialVersionUID = 1L;
	
	private String errorCode;


	public CustomException() {
		super();
	}
	
	public CustomException(String message) {
		super(message);
	}

	public String getErrorCode() {
		return errorCode;
	}

	public void setErrorCode(String errorCode) {
		this.errorCode = errorCode;
	}
	
	public static Throwable getRootCause(Exception e){
		Throwable cause=e;
		boolean b=false;
		if(cause.getCause()==null) b=true;
		while(!b){
			cause=cause.getCause();
			if(cause.getCause()==null) b=true;
		}
		return cause;
	}
}
